package com.zw.cloud.common.utils;

import com.fasterxml.jackson.databind.JsonNode;
import com.github.victools.jsonschema.generator.*;
import com.zw.cloud.common.entity.dto.GemiRealTimeData;
import org.everit.json.schema.Schema;
import org.everit.json.schema.loader.SchemaLoader;
import org.json.JSONObject;
import org.json.JSONTokener;

import java.io.InputStream;
import java.lang.reflect.Type;

public class JsonschemaGenerator {

    public static void main(String[] args) {
        /*String schemaJsonString = schemaGenerator(GemiRealTimeData.class);
        System.out.println(schemaJsonString);
        validateDraft(buildsSchemaJson(),buildNeedCheckJSONObject());*/

        InputStream inputStream = JsonschemaGenerator.class.getResourceAsStream("/stenter-check.json");
        JSONObject schemaJson = new JSONObject(new JSONTokener(inputStream));
        validateDraft(schemaJson,buildNeedCheckJSONObject());
    }
    public static String schemaGenerator(Type mainTargetType) {
        SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_7, OptionPreset.PLAIN_JSON);
        SchemaGeneratorConfig config = configBuilder.build();
        SchemaGenerator generator = new SchemaGenerator(config);
        JsonNode jsonSchema = generator.generateSchema(mainTargetType);
        return jsonSchema.toPrettyString();
    }

    /**
     * json 验证
     */
    public static void validateDraft(String schemaJsonString, JSONObject data){
        SchemaLoader loader = SchemaLoader.builder()
                .schemaJson(new JSONObject(schemaJsonString))
                .draftV7Support()
                .build();
        Schema schema = loader.load().build();
        schema.validate(data);
    }

    /**
     * json 验证
     */
    public static void validateDraft(JSONObject schemaJson, JSONObject data){
        SchemaLoader loader = SchemaLoader.builder()
                .schemaJson(schemaJson)
                .draftV7Support()
                .build();
        Schema schema = loader.load().build();
        schema.validate(data);
    }

    private static JSONObject buildNeedCheckJSONObject() {
        String s = "{\n" +
                "    \"sdata\":{\n" +
                "        \"link\":{\n" +
                "            \"name\":\"864337057481138\",\n" +
                "            \"type\":\"baidu\"\n" +
                "        },\n" +
                "        \"stenterStatus\":{\n" +
                "            \"ctime\":1699323334,\n" +
                "            \"d01\":78,\n" +
                "            \"d02\":78,\n" +
                "            \"d03\":56,\n" +
                "            \"d04\":56,\n" +
                "            \"d05\":56,\n" +
                "            \"d06\":40,\n" +
                "            \"d07\":130.4,\n" +
                "            \"d08\":40,\n" +
                "            \"d09\":180.56,\n" +
                "            \"d10\":40,\n" +
                "            \"d100\":80,\n" +
                "            \"d101\":80,\n" +
                "            \"d11\":100,\n" +
                "            \"d12\":40,\n" +
                "            \"d13\":56,\n" +
                "            \"d14\":40,\n" +
                "            \"d15\":56,\n" +
                "            \"d150\":1.6,\n" +
                "            \"d16\":40,\n" +
                "            \"d17\":56,\n" +
                "            \"d18\":40,\n" +
                "            \"d19\":56,\n" +
                "            \"d20\":40,\n" +
                "            \"d21\":56,\n" +
                "            \"d22\":40,\n" +
                "            \"d23\":56,\n" +
                "            \"d24\":12,\n" +
                "            \"d25\":56,\n" +
                "            \"d26\":56,\n" +
                "            \"d27\":56,\n" +
                "            \"d28\":56,\n" +
                "            \"d29\":56,\n" +
                "            \"d30\":56,\n" +
                "            \"d31\":56,\n" +
                "            \"d32\":56,\n" +
                "            \"d33\":56,\n" +
                "            \"d34\":40,\n" +
                "            \"d35\":56,\n" +
                "            \"d36\":40,\n" +
                "            \"d37\":56,\n" +
                "            \"d38\":40,\n" +
                "            \"d39\":56,\n" +
                "            \"d40\":40,\n" +
                "            \"d400\":40,\n" +
                "            \"d401\":56,\n" +
                "            \"d41\":56,\n" +
                "            \"d42\":40,\n" +
                "            \"d43\":56,\n" +
                "            \"d44\":40,\n" +
                "            \"d45\":56,\n" +
                "            \"d46\":40,\n" +
                "            \"d47\":56,\n" +
                "            \"d48\":40,\n" +
                "            \"d49\":56,\n" +
                "            \"d50\":40,\n" +
                "            \"d500\":56,\n" +
                "            \"d501\":56,\n" +
                "            \"d502\":56,\n" +
                "            \"d51\":56,\n" +
                "            \"d52\":40,\n" +
                "            \"d53\":56,\n" +
                "            \"d54\":40,\n" +
                "            \"d55\":56,\n" +
                "            \"d56\":40,\n" +
                "            \"d57\":56,\n" +
                "            \"d58\":40,\n" +
                "            \"d59\":56,\n" +
                "            \"d60\":56,\n" +
                "            \"d600\":56,\n" +
                "            \"d601\":56,\n" +
                "            \"d602\":56,\n" +
                "            \"d603\":56,\n" +
                "            \"d604\":40,\n" +
                "            \"d605\":56,\n" +
                "            \"d606\":40,\n" +
                "            \"d607\":56,\n" +
                "            \"d608\":40,\n" +
                "            \"d609\":56,\n" +
                "            \"d61\":56,\n" +
                "            \"d610\":40,\n" +
                "            \"d611\":56,\n" +
                "            \"d612\":40,\n" +
                "            \"d613\":56,\n" +
                "            \"d614\":40,\n" +
                "            \"d615\":56,\n" +
                "            \"d616\":40,\n" +
                "            \"d617\":56,\n" +
                "            \"d618\":40,\n" +
                "            \"d619\":56,\n" +
                "            \"d620\":40,\n" +
                "            \"d621\":56,\n" +
                "            \"d622\":40,\n" +
                "            \"d623\":56,\n" +
                "            \"d624\":40,\n" +
                "            \"d625\":56,\n" +
                "            \"d626\":40,\n" +
                "            \"d627\":120,\n" +
                "            \"d628\":40,\n" +
                "            \"d629\":110,\n" +
                "            \"d65\":40,\n" +
                "            \"d66\":56,\n" +
                "            \"d67\":40,\n" +
                "            \"d68\":56,\n" +
                "            \"d69\":40,\n" +
                "            \"d70\":56,\n" +
                "            \"d700\":56,\n" +
                "            \"d701\":56,\n" +
                "            \"d702\":56,\n" +
                "            \"d703\":56,\n" +
                "            \"d704\":56,\n" +
                "            \"d705\":56,\n" +
                "            \"d706\":56,\n" +
                "            \"d707\":56,\n" +
                "            \"d708\":1,\n" +
                "            \"d71\":40,\n" +
                "            \"d72\":56,\n" +
                "            \"d73\":40,\n" +
                "            \"d74\":56,\n" +
                "            \"d75\":40,\n" +
                "            \"d76\":56,\n" +
                "            \"d77\":40,\n" +
                "            \"d78\":56,\n" +
                "            \"d79\":40,\n" +
                "            \"d80\":56,\n" +
                "            \"d81\":40,\n" +
                "            \"d82\":56,\n" +
                "            \"d83\":80,\n" +
                "            \"d84\":80,\n" +
                "            \"d85\":80,\n" +
                "            \"d86\":80,\n" +
                "            \"d87\":80,\n" +
                "            \"d88\":80,\n" +
                "            \"d89\":80,\n" +
                "            \"d90\":80,\n" +
                "            \"d91\":80,\n" +
                "            \"d92\":80,\n" +
                "            \"d93\":80,\n" +
                "            \"d94\":80,\n" +
                "            \"d95\":80,\n" +
                "            \"d96\":80,\n" +
                "            \"d97\":80,\n" +
                "            \"d98\":80,\n" +
                "            \"d99\":80,\n" +
                "            \"ec\":8830,\n" +
                "            \"mt\":1,\n" +
                "            \"rtime\":1699323334\n" +
                "        }\n" +
                "    },\n" +
                "    \"mdata\":{\n" +
                "        \"cloudTime\":1699323274,\n" +
                "        \"created\":true,\n" +
                "        \"dataModel\":\"shadow\",\n" +
                "        \"device\":{\n" +
                "            \"name\":\"864337057481138\",\n" +
                "            \"ns\":\"dyeing\"\n" +
                "        },\n" +
                "        \"labels\":{\n" +
                "            \"activateStatus\":\"activated\",\n" +
                "            \"activateTime\":\"2023-08-03T04:33:46.247Z\",\n" +
                "            \"batchId\":\"64ae626a0938e5000123e4a8\",\n" +
                "            \"bindStatus\":\"1\",\n" +
                "            \"deviceModel\":\"\",\n" +
                "            \"kind\":\"device\",\n" +
                "            \"machineId\":\"1435524332014460929\",\n" +
                "            \"machineNum\":\"864337057481138\",\n" +
                "            \"moduleCategory\":\"STD2\",\n" +
                "            \"mt\":\"stenter\",\n" +
                "            \"orgCode\":\"3983D94F788342E1B0D8F52EA890D8E8\",\n" +
                "            \"orgName\":\"qa测试工厂\",\n" +
                "            \"supplier\":\"\"\n" +
                "        },\n" +
                "        \"link\":{\n" +
                "            \"name\":\"864337057481138\",\n" +
                "            \"type\":\"baidu\"\n" +
                "        },\n" +
                "        \"mqtt\":{\n" +
                "            \"mid\":\"7a56830f6d734c0bb5298122e40e026a\",\n" +
                "            \"topic\":\"d/864337057481138/report\"\n" +
                "        },\n" +
                "        \"msg\":{\n" +
                "            \"id\":\"110f6bcb-d994-479b-96fc-44053a1a6e6d\",\n" +
                "            \"kafkaReceiveTime\":\"2023-11-07T02:14:34.787898118Z\",\n" +
                "            \"kafkaSendTime\":\"2023-11-07T02:14:34.784Z\",\n" +
                "            \"subTopic\":\"dyeing\",\n" +
                "            \"topic\":\"mqtt_report_dyeing\"\n" +
                "        },\n" +
                "        \"receiveTime\":1699323274789\n" +
                "    }\n" +
                "}";
        return new JSONObject(s);
    }


    private static String buildsSchemaJson() {
        return "{\n" +
                "    \"title\":\"message\",\n" +
                "    \"description\":\"A message from gemi kafka topic gemi_device_upstream_qms\",\n" +
                "    \"type\":\"object\",\n" +
                "    \"properties\":{\n" +
                "        \"sdata\":{\n" +
                "            \"description\":\"business data\",\n" +
                "            \"type\":\"object\",\n" +
                "            \"properties\":{\n" +
                "                \"messageType\":{\n" +
                "                    \"description\":\"message type\",\n" +
                "                    \"type\":\"string\"\n" +
                "                },\n" +
                "                \"stenterStatus\":{\n" +
                "                    \"type\":\"object\",\n" +
                "                    \"properties\":{\n" +
                "                        \"ctime\":{\n" +
                "                            \"type\":\"integer\"\n" +
                "                        },\n" +
                "                        \"d01\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d02\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d03\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d04\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d05\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d06\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d07\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d08\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d09\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d10\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d100\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d101\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d11\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d12\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d13\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d14\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d15\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d150\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d16\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d17\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d18\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d19\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d20\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d21\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d22\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d23\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d24\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d25\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d26\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d27\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d28\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d29\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d30\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d300\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d31\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d32\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d33\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d34\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d35\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d36\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d37\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d38\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d39\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d40\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d400\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d401\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d41\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d42\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d43\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d44\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d45\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d46\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d47\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d48\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d49\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d50\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d500\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d501\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d502\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d51\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d52\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d53\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d54\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d55\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d56\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d57\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d58\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d59\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d60\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d600\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d601\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d602\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d603\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d604\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d605\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d606\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d607\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d608\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d609\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d61\":{\n" +
                "                            \"type\":\"integer\"\n" +
                "                        },\n" +
                "                        \"d610\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d611\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d612\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d613\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d614\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d615\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d616\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d617\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d618\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d619\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d62\":{\n" +
                "                            \"type\":\"integer\"\n" +
                "                        },\n" +
                "                        \"d620\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d621\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d622\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d623\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d624\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d625\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d626\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d627\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d628\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d629\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d63\":{\n" +
                "                            \"type\":\"integer\"\n" +
                "                        },\n" +
                "                        \"d64\":{\n" +
                "                            \"type\":\"integer\"\n" +
                "                        },\n" +
                "                        \"d65\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d66\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d67\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d68\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d69\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d70\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d700\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d701\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d702\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d703\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d704\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d705\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d706\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d707\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d708\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d71\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d72\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d73\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d74\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d75\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d76\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d77\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d78\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d79\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d80\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d81\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d82\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d83\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d84\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d85\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d86\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d87\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d88\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d89\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d90\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d91\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d92\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d93\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d94\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d95\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d96\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d97\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d98\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"d99\":{\n" +
                "                            \"type\":\"number\"\n" +
                "                        },\n" +
                "                        \"ec\":{\n" +
                "                            \"type\":\"integer\"\n" +
                "                        },\n" +
                "                        \"mt\":{\n" +
                "                            \"type\":\"integer\"\n" +
                "                        },\n" +
                "                        \"rtime\":{\n" +
                "                            \"type\":\"integer\"\n" +
                "                        }\n" +
                "                    },\n" +
                "                    \"required\":[\n" +
                "                        \"ctime\",\n" +
                "                        \"rtime\"\n" +
                "                    ]\n" +
                "                }\n" +
                "            },\n" +
                "            \"required\":[\n" +
                "                \"stenterStatus\"\n" +
                "            ]\n" +
                "        },\n" +
                "        \"mdata\":{\n" +
                "            \"description\":\"metadata data\",\n" +
                "            \"type\":\"object\",\n" +
                "            \"properties\":{\n" +
                "                \"device\":{\n" +
                "                    \"description\":\"device info\",\n" +
                "                    \"type\":\"object\",\n" +
                "                    \"properties\":{\n" +
                "                        \"name\":{\n" +
                "                            \"description\":\"device name\",\n" +
                "                            \"type\":\"string\"\n" +
                "                        }\n" +
                "                    },\n" +
                "                    \"required\":[\n" +
                "                        \"name\"\n" +
                "                    ]\n" +
                "                }\n" +
                "            },\n" +
                "            \"required\":[\n" +
                "                \"device\"\n" +
                "            ]\n" +
                "        }\n" +
                "    },\n" +
                "    \"required\":[\n" +
                "        \"sdata\",\n" +
                "        \"mdata\"\n" +
                "    ]\n" +
                "}";
    }

}
